package com.spddr.pmos.cxf.impl;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import com.spddr.pmos.cxf.JaxrsRiver;
import com.spddr.pmos.jpa.Reservoir;
import com.spddr.pmos.jpa.River;
import com.spddr.pmos.repos.ReservoirRepos;
import com.spddr.pmos.repos.RiverRepos;

@Service
public class JaxrsRiverImpl extends AbstractJaxrsObjectImpl<River> implements JaxrsRiver {
	@Autowired
	private RiverRepos repository;

	@Autowired
	private ReservoirRepos reservoirRepos;

	@Override
	public JpaRepository<River, Long> getRepository() {
		return repository;
	}

	@Override
	public Collection<Reservoir> reservoirs(long river) {
		return reservoirRepos.findByRiverId(river);
	}
}
